<template>
  <div class="first">
    <div class="title">数据清除</div>
    <el-button
      type="warning"
      size="medium"
      icon="el-icon-video-play"
      :loading="loading"
      @click="execute"
      style="margin-left: 20px"
      >执行</el-button
    >
  </div>
</template>

<script>
import { deleteDate } from "@/common/api";
export default {
  name: "DeleteDate",
  props: {},
  components: {},
  data() {
    return {
      loading: false,
    };
  },
  methods: {
    execute() {
      this.loading = true;
      deleteDate({ funName: "批次合同" })
        .then((res) => {
          this.loading = false;
          if (res.success == 1) {
            this.$successMsg(res.message);
          } else {
            this.$errorMsg(res.message);
          }
        })
        .catch((err) => {
          this.loading = false;
          this.$errorMsg("接口异常");
        });
    },
  },
};
</script>


<style lang="scss" scoped>
.first {
  display: flex;
  align-items: center;
  height: 50px;
  padding: 10px 20px;

  .title {
    font-size: 22px;
    font-weight: bold;
    color: #249087;
  }
}
</style>